package com.neuedu.wemall.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Author lu
 * Date  2025-09-08 15:17:25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Alias("product")
@TableName(value = "product")
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 商品ID
     */
    @TableField(value = "id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    @TableField(value = "title")
    private String title;
    /**
     * 封面图
     */
    @TableField(value = "cover")
    private String cover;
    /**
     * 价格(单位:分)
     */
    @TableField(value = "price")
    private Integer price;
    /**
     * 所属一级分类ID
     */
    @TableField(value = "cat_id1")
    private Integer catId1;
    /**
     * 所属二级分类ID
     */
    @TableField(value = "cat_id2")
    private Integer catId2;
    /**
     * 品牌ID
     */
    @TableField(value = "brand_id")
    private Integer brandId;
    /**
     * 商品图文
     */
    @TableField(value = "content")
    private String content;
    /**
     * 标签
     */
    @TableField(value = "tags")
    private String tags;
    /**
     * 规格或参数
     */
    @TableField(value = "specs")
    private String specs;
    /**
     * 库存数量
     */
    @TableField(value = "stock")
    private Integer stock;
    /**
     * 已售出数量
     */
    @TableField(value = "sold")
    private Integer sold;
    /**
     * 商品状态(1:未上架;2:已上架;3:已下架;4:已售罄)
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;
    /**
     * 创建用户ID
     */
    @TableField(value = "create_user")
    private Integer createUser;
    /**
     * 修改时间
     */
    @TableField(value = "modify_time")
    private Date modifyTime;
    /**
     * 修改用户ID
     */
    @TableField(value = "modify_user")
    private Integer modifyUser;
    /**
     * 备注信息
     */
    @TableField(value = "remark")
    private String remark;
    /**
     * 逻辑删除状态(1:未删除;9:已删除)
     */
    @TableField(value = "del_status")
    private Integer delStatus;
    /**
     * 二级分类
     */
    @TableField(exist = false)
    private Category sub;
    /**
     * 一级分类
     */
    @TableField(exist = false)
    private Category sup;
    /**
     * 品牌
     */
    @TableField(exist = false)
    private Brand brand;
    /**
     * 商品图片
     */
    @TableField(exist = false)
    private List<ProdImg> imgList;
}